package com.fourth.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fourth.dao.DepositDao;
import com.fourth.service.DepositService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ljx.config.PageConfig;
import com.ljx.entity.Deposit;
import com.ljx.entity.Permission;
import com.ljx.vo.Result;
import feign.QueryMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author xiaoZhu
 * @version 1.0
 * @date 2023/2/27 11:51
 */
@Service
public class DepositServiceImpl extends ServiceImpl<DepositDao, Deposit> implements DepositService {

    @Autowired
    private DepositDao depositDao;

    @Override
    public Result selectAll( Integer pageSize,Integer currentPage,Deposit deposit) {

        PageHelper.startPage(pageSize,currentPage);
        QueryWrapper<Deposit> wrapper = new QueryWrapper<>();
        if (deposit.getDepositname()!= null){
            wrapper.like("depositname",deposit.getDepositname());
        }

        List<Deposit> list = depositDao.selectList(wrapper);
        PageInfo<Deposit> depositPageInfo = new PageInfo<>(list);
        return new Result(200,"查询成功",depositPageInfo);
    }
}
